package concrete;

import java.util.Random;

public class Deck extends Tile {


	//VARIABLES
	private int number;
	private boolean getOutJail;
	Random random = new Random();


	//CONSTRUCTOR/S
	public Deck(String tileName) {
		super(tileName);
		this.number = 0;
		this.getOutJail = true;
	}


	//GETTER/S
	public int getNumber() {
		return this.number;
	}
	public boolean getGetOutJail() {
		return this.getOutJail;
	}


	//SETTER/S
	public void setNumber(int number) {
		this.number = number;
	}
	public void setGetOutJail(boolean getOutJail) {
		this.getOutJail = getOutJail;
	}


	//OTHER METHODS
	public int drawDeck() {

		
		int max;
		//Determine last number of random whether Get Out of Jail Card is still available
		if(getOutJail)
			max = 16;
		else
			max = 15;
		
		//Generate a random integer from 1 to 16
		long range=(long)max - (long)1 + 1;
		long fraction=(long)(range * random.nextDouble());
		this.number=(int)(fraction + 1);
		
		//return 7;
		return this.number;
	}
}
